package com.cnzhy.config;

import com.cnzhy.handler.JwtTokenArgumentResolver;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.util.List;

/**
 * @Author: zhaoyan5
 * 通过实现WebMvcConfigurer接口来添加自定义拦截器
 */
@SpringBootConfiguration
public class SpringMvcConfig implements WebMvcConfigurer {

    /**
     * 添加自定义方法参数拦截器
     */
    @Override
    public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
        argumentResolvers.add(new JwtTokenArgumentResolver());
    }

}
